<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="renderer" content="webkit">
	<title>变更云商宝商户结算产品费率</title>
	<link rel="icon" href="favicon.ico" type="image/x-icon"/>
	<!-- 当前页面样式 -->
	<link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
	<!-- 当前页面样式 END -->
	<script type="text/javascript" src="<c:url value="/js/jquery-1.3.2.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
	<script type='text/javascript' src='<s:url value="/js/pageAjax.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/dwr/engine.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/dwr/interface/MccQuery.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/js/querySon.js"/>'></script>
	<script type="text/javascript" src="<s:url value="/js/jquery.validate.js" />"></script>
	<script type="text/javascript" src="<s:url value="/js/pwms.validate.js" />"></script>
	<style>
		.fieldError { color: red; text-align: left; }
		.error { float: none; color: red;  vertical-align: top;font-size: 11px;}
	</style>
	<script>
		$(function(){
			$("#editYsbmchtFeeForm").validate({
				debug : true,
				submitHandler : function(form) {
					$("#submitBtn").attr("disabled",true);
					form.submit();
				},
				rules : {
					"mchtBizFees[0].mchtFeePercent":{required:true,isDecimal: function(){
						var min= 0.5;	var max = 0.75;	var accuracy = 2;
						return [min, max, accuracy];
					}},
					"mchtBizFees[0].mchtFeePctMax":{required:true,isDecimal: function(){
						var min= 20;		var max = 300; var accuracy = 3;
						return [min, max,accuracy];
					}},
					"mchtBizFees[1].mchtFeePercent":{required:true,isDecimal: function(){
						var min= 0.55;	var max = 0.75;	var accuracy = 2;
						return [min, max, accuracy];
					}},
					"mchtBizFees[2].mchtFeePercent":{required:true,isDecimal: function(){
						var min= 0.55;	var max = 0.75;	var accuracy = 2;
						return [min, max, accuracy];
					}},
					"mchtBizFees[3].mchtFeePercent":{required:true,isDecimal: function(){
						var min= 0.55;	var max = 0.75;	var accuracy = 2;
						return [min, max, accuracy];
					}},
				},
				messages : {
					"mchtBizFees[0].mchtFeePercent":{required:"必填"},
					"mchtBizFees[0].mchtFeePctMax":{required:"必填",min:"最低20",max:"最高300"},
					"mchtBizFees[1].mchtFeePercent":{required:"必填"},
					"mchtBizFees[2].mchtFeePercent":{required:"必填"},
					"mchtBizFees[3].mchtFeePercent":{required:"必填"} 
				},errorPlacement: function(error, element) { 
					if ( element.is(":radio") ) error.appendTo ( element.parent() ); 
					else if ( element.is(":checkbox") ) error.appendTo ( element.parent()); 
					else if ( element.is("input") ) error.appendTo ( element.parent().next() ); 
					else if ( element.is("select") ) error.appendTo ( element ); 
					else error.insertAfter(element); 
				} 
			});
		});
	
	</script>
</head>
<body>
<s:form id="editYsbmchtFeeForm" action="/merinfoysb/editYsbMchtFees.ct" method="post" theme="simple">
<s:hidden name="merchantsNo" value="%{#request.mcht_no}"/>
<s:hidden name="merinfo.id" />
<s:hidden name="merinfo.contactPhoneNo" />
<table class="tb">
	<tbody>
		<tr class="tb-line">
			<td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
		</tr>
		<tr class="tb-line">
			<td class="tb-td" colspan="4"><div class="tb-h3">变更云商宝商户结算产品费率</div></td>
		</tr>
			<table class="tb" style="width: 100%;">
				<tbody>
					<tr class="tb-line">
						<td class="tb-td">商户号：</th>
						<td class="tb-td"><s:property value="merinfo.id"/></td>
					</tr>
					<tr class="tb-line">
						<td class="tb-td">商户简称：</th>
						<td class="tb-td"><s:property value="merinfo.nameBusi"/></td>
					</tr>
					<tr class="tb-line">
						<td class="tb-td">手机号码：</th>
						<td class="tb-td"><s:property value="merinfo.contactPhoneNo"/></td>
					</tr>
					<s:iterator value="#request.searchRsList" status="stat" var="mchtFee">
						<tr class="tb-line" >
								<td class="tb-td" width="10%" style="min-width: 130px"><s:property value="#mchtFee.mchtFeeMd"/></td>
								<td><label class="tb-input-mini">
									<s:textfield name="mchtBizFees[%{#stat.index}].mchtFeePercent" value="%{#mchtFee.mchtFeePercent}"></s:textfield>
									</label>%<span></span> 
									<s:if test="#mchtFee.subBizCd==\"0001000\"">
										-<label class="tb-input-mini">
											<s:textfield name="mchtBizFees[%{#stat.index}].mchtFeePctMax" value="%{#mchtFee.mchtFeePctMax}"></s:textfield>
										</label>封顶<span></span> 
									</s:if>
									<code class="asterisk">*</code>
									<s:hidden name="mchtBizFees[%{#stat.index}].mchtCd" value="%{#mchtFee.mchtCd}"/>
									<s:hidden name="mchtBizFees[%{#stat.index}].prodCd" value="%{#mchtFee.prodCd}"/>
									<s:hidden name="mchtBizFees[%{#stat.index}].bizCd" value="%{#mchtFee.bizCd}"/>
									<s:hidden name="mchtBizFees[%{#stat.index}].subBizCd" value="%{#mchtFee.subBizCd}"/>
								</td>
						</tr>
					</s:iterator>
				</tbody>
			</table>
			<div align="center"  class="line-submit bg-gray">
				<s:if test="#request.roleType != '10'">
					<label class="tb-input-submit"  >
						<input id="submitBtn" type="submit" value="提交" />
					</label>
				</s:if>
				<label class="tb-input-submit">
					<input type="button" value="返回" onclick="history.back()"/>
				</label>
			</div>
	</tbody>
</table>
</s:form>
<s:if test="#request.msg !=null">
	<script language="javascript">
		alert("${request.msg}");
	</script>
</s:if>
</body>
</html>